package com.kx.springboot.web;

import com.kx.springboot.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {
    @RequestMapping("/literal")
    public Object literal(Model model){
        model.addAttribute("sex",0);
        model.addAttribute("data","SpringBoot Literal");
        model.addAttribute("flag",true);

        User user = new User();
        user.setId(101);
        user.setUsername("zkx");
        model.addAttribute("user",user);

        User user1 = new User();
        model.addAttribute("user1",user1);

        return "literal";
    }
    @RequestMapping("/splice")
    public Object splice(Model model){
        model.addAttribute("totalRows",123);
        model.addAttribute("totalPage",13);
        model.addAttribute("currentPage",2);
        return "splice";
    }
}
